package com.showsu.editor.entity.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.annotations.SerializedName;
import com.showsu.editor.utils.StringUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Author: William
 * @Description:
 * @Date: Created in 10:16 上午 2023/6/20
 * @Modified By:
 */
@Data
public class AwemeListPlatformResult implements Serializable {

    private Integer code;
    private Integer status_code;
    private Boolean success;
    private String msg;
    private AwemeListData data;

    @Data
    public class AwemeListData implements Serializable {
        private List<Note> notes;
        private List<Tag> tags;
        private String bydev;
        private String cursor;

        @Data
        @JsonInclude(JsonInclude.Include.NON_NULL)
        public class Note implements Serializable {
            private String cursor;
            private Integer level;
            private String display_title;
//            private VideoInfoV2 video_info_v2;
//            private Recommend recommend;
            private String title;
            private String type;
//            private Boolean is_goods_note;
            /**
             * 发布时间，10位时间戳
             */
            @SerializedName(value = "create_time", alternate = {"time"})
            private Long create_time;
            private Long last_update_time;
//            private Boolean inlikes;
//            private Integer price;
//            private AdvancedWidgetsGroups advanced_widgets_groups;
//            private Boolean sticky;
            //笔记id，有的接口是id，有的是note_id
            @SerializedName(value = "id", alternate = {"note_id"})
            private String id;
//            private String widgets_context;
            private List<Image> images_list;
            private Cover cover;
            private User user;
            private Integer view_count;
            private String desc;
            @SerializedName("likes")
            private Integer likes;
            @SerializedName("collected_count")
            private Integer collected_count;
            @SerializedName("comments_count")
            private Integer comments_count;
            @SerializedName("share_count")
            private Integer share_count;
//            private Boolean has_music;
            private InteractInfo interact_info;
            private String xsec_token;

            @Data
            public class VideoInfoV2 implements Serializable {
                private String target_name;
                private String track_id;
                private String icon;
                private String target_id;
                private String type;
                private String desc;
            }

            @Data
            public class Recommend implements Serializable {
            }

            @Data
            public class AdvancedWidgetsGroups implements Serializable {
            }

            @Data
            public class Image implements Serializable {
//                private String trace_id;
//                private String original;
//                private Boolean need_load_original_image;
//                private Integer width;
//                private String url_size_large;
                private String url;
//                private String fileid;
//                private Integer height;
            }

            @Data
            public class User implements Serializable {
                @SerializedName(value = "images", alternate = {"image"})
                private String images;
                private String avatar;
                /**
                 * 达人昵称
                 */
                private String nickname;
                //有的接口是userid，有的是user_id
                @SerializedName(value = "user_id", alternate = {"userid"})
                private String user_id;
            }

            @Data
            public class InteractInfo implements Serializable {
                private String liked_count;
                private Boolean liked;
                private Boolean sticky;
                public Integer getLiked_count() {
                    return StringUtil.changeFuzzyWriting2Number(liked_count);
                }
            }

            @Data
            public class Cover implements Serializable {
                private String file_id;
                private Integer height;
                private Integer width;
                private String url;
                private List<Info> info_list;
                @Data
                public class Info implements Serializable {
                    private String image_scene;
                    private String url;
                }
            }
        }

        @Data
        public class Tag implements Serializable {
        }

    }
}
